using System;
using System.Collections.Generic;
using System.Text;
using BusinessObjects.BO_Actions.Sec_Group_Admin;
using Entity.StoreProcedure;
using BusinessObjects;
using System.Data;
using BussinessObjects;
using BussinessObjects.BO_Actions.Sec_Group_Admin;
namespace BusinessObjects.BO_GetObjects
{
    public static class BO_Sec_Group_Admin
    {
        public static DataTable SelectAll(int status)
        {
            try
            {
                BOSec_Group_Admin_Select_All action = new BOSec_Group_Admin_Select_All();
                usp_Sec_Group_Admin_Select_All entity = new usp_Sec_Group_Admin_Select_All();
                entity.STATUS = status;
                
                return action.ExecuteAndReturnDataTable(entity);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public static DataTable SelectParent(int status, int parentid)
        {
            try
            {
                BOSec_Group_Admin_Select_Parent action = new BOSec_Group_Admin_Select_Parent();
                usp_Sec_Group_Admin_Select_Parent entity = new usp_Sec_Group_Admin_Select_Parent();
                entity.STATUS = status;
                entity.PARENT = parentid;
                
                return action.ExecuteAndReturnDataTable(entity);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public static DataTable SelectTop(int rows, int status)
        {
            try
            {
                BOSec_Group_Admin_Select_Top action = new BOSec_Group_Admin_Select_Top();
                usp_Sec_Group_Admin_Select_Top entity = new usp_Sec_Group_Admin_Select_Top();
                entity.NUMBERRECORD = rows;
                entity.STATUS = status;
                
                return action.ExecuteAndReturnDataTable(entity);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public static DataTable Search(int group_admin_id)
        {
            try
            {
                BOSec_Group_Admin_Search action = new BOSec_Group_Admin_Search();
                usp_Sec_Group_Admin_Search entity = new usp_Sec_Group_Admin_Search();
                entity.GROUP_ADMIN_ID = group_admin_id;
                
                return action.ExecuteAndReturnDataTable(entity);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public static DataTable SelectWithPaged(int startIndex, int pageCount, int status)
        {
            try
            {
                BOSec_Group_Admin_Select_WithPaged action = new BOSec_Group_Admin_Select_WithPaged();
                usp_Sec_Group_Admin_Select_WithPaged entity = new usp_Sec_Group_Admin_Select_WithPaged();
                entity.STARTINDEX = startIndex;
                entity.MAXRECORDS = pageCount;
                entity.STATUS = status;
                
                return action.ExecuteAndReturnDataTable(entity);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public static string Insert(int PARENT_GROUP_ID, string ADMIN_MODULE_ID, string GROUP_NAME, string DESCRIPTION, int SORT_DISPLAY, DateTime CREATED_DATE, string CREATED_BY, DateTime MODIFY_DATE, string MODIFY_BY, bool STATUS)
        {
            try
            {
                BOSec_Group_Admin_Insert action = new BOSec_Group_Admin_Insert();
                usp_Sec_Group_Admin_Insert entity = new usp_Sec_Group_Admin_Insert();
                entity.PARENT_GROUP_ID = PARENT_GROUP_ID;
                entity.ADMIN_MODULE_ID = ADMIN_MODULE_ID;
                entity.GROUP_NAME = GROUP_NAME;
                entity.DESCRIPTION = DESCRIPTION;
                entity.SORT_DISPLAY = SORT_DISPLAY;
                entity.CREATED_DATE = CREATED_DATE;
                entity.CREATED_BY = CREATED_BY;
                entity.MODIFY_DATE = MODIFY_DATE;
                entity.MODIFY_BY = MODIFY_BY;
                entity.STATUS = STATUS;
                
                return action.ExecuteAndReturnStringValue(entity);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public static string Update ( int GROUP_ADMIN_ID, int PARENT_GROUP_ID, string ADMIN_MODULE_ID, string GROUP_NAME, string DESCRIPTION, int SORT_DISPLAY, DateTime CREATED_DATE, string CREATED_BY, DateTime MODIFY_DATE, string MODIFY_BY, bool STATUS )
        {
            try
            {
                BOSec_Group_Admin_Update action = new BOSec_Group_Admin_Update();
                usp_Sec_Group_Admin_Update entity = new usp_Sec_Group_Admin_Update();
                entity.GROUP_ADMIN_ID = GROUP_ADMIN_ID;
                entity.PARENT_GROUP_ID = PARENT_GROUP_ID;
                entity.ADMIN_MODULE_ID = ADMIN_MODULE_ID;
                entity.GROUP_NAME = GROUP_NAME;
                entity.DESCRIPTION = DESCRIPTION;
                entity.SORT_DISPLAY = SORT_DISPLAY;
                entity.CREATED_DATE = CREATED_DATE;
                entity.CREATED_BY = CREATED_BY;
                entity.MODIFY_DATE = MODIFY_DATE;
                entity.MODIFY_BY = MODIFY_BY;
                entity.STATUS = STATUS;
                
                return action.ExecuteAndReturnStringValue(entity);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public static bool Delete(int group_admin_id)
        {
            try
            {
                BOSec_Group_Admin_Delete action = new BOSec_Group_Admin_Delete();
                usp_Sec_Group_Admin_Delete entity = new usp_Sec_Group_Admin_Delete();
                entity.GROUP_ADMIN_ID = group_admin_id;
                
                return action.ExecuteAndReturnBooleanValue(entity);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public static bool Restore(int group_admin_id)
        {
            try
            {
                BOSec_Group_Admin_Restore action = new BOSec_Group_Admin_Restore();
                usp_Sec_Group_Admin_Restore entity = new usp_Sec_Group_Admin_Restore();
                entity.GROUP_ADMIN_ID = group_admin_id;
                
                return action.ExecuteAndReturnBooleanValue(entity);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
    }
}

